<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE html>
<html lang="en">
<head>
<jsp:include page="/pages/elements/head.jsp" />
</head>

<body>
	<jsp:include page="/pages/elements/scripts.jsp" />

	<jsp:include page="/pages/elements/menu.jsp" />

	<div class="tabbable tabs-left">
		<ul class="nav nav-tabs" id="q1_menu">
			<li><a href="#info" data-toggle="tab">Info</a></li>
			<li><a href="#q1" class='q1' data-toggle="tab">Query 1</a></li>
			<li><a href="#q2" class='q2' data-toggle="tab">Query 2</a></li>
			<li><a href="#q3" class='q3' data-toggle="tab">Query 3</a></li>
			<li><a href="#q4" class='q4' data-toggle="tab">Query 4</a></li>
			<li><a href="#q5" class='q5' data-toggle="tab">Query 5</a></li>
			<li><a href="#q6" class='q6' data-toggle="tab">Query 6</a></li>
		</ul>

		<div class="tab-content">
			<div class="tab-pane" id="info">
				<p>query 1:${fn:escapeXml("#{ db.((Employee as emp) where count(emp.deals) > 7) }")}</p>
				<p>query 2: ${fn:escapeXml("#{ db.((Customer as c) where c.liveAddress.street == 'Jasna') }")}</p>
				<p>query 3: ${fn:escapeXml("#{ db.((Deal as d) where d.employee.job == 'szef' and d.dealDate.year >= 2010) }")}</p>
				<p>query 4: ${fn:escapeXml("#{ db.((Customer as c) where sum(c.deals.cost) < 1000) };")}</p>
				<p>query 5: ${fn:escapeXml("#{ #{ db.((Rank as r) where not(count(r.customers.deals.cost) > 2100000)) }; ")}</p>
				<p>query 6: ${fn:escapeXml("#{ db.((Customer as c) where c.ranks.groupName != 'Partner biznesowy' and count(c.deals) >= 5) };")}</p>
				<p>query 7: ${fn:escapeXml("#{ #{ 2+9*2/2%3 }; };")} = <c:out value="${q7}" /></p>
			</div>
			<div class="tab-pane" id="q1">
				<jsp:include page="q1.jsp" />
			</div>
			<div class="tab-pane" id="q2">
				<jsp:include page="q2.jsp" />
			</div>
			<div class="tab-pane" id="q3">
				<jsp:include page="q3.jsp" />
			</div>
			<div class="tab-pane" id="q4">
				<jsp:include page="q4.jsp" />
			</div>
			<div class="tab-pane" id="q5">
				<jsp:include page="q5.jsp" />
			</div>
			<div class="tab-pane" id="q6">
				<jsp:include page="q6.jsp" />
			</div>
		</div>
	</div>
</body>
</html>
